package com.hqj.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

@RestController
public class ProviderController {

    @Value("${server.port}")
    private String port;

    @RequestMapping("/getInfo")
    public String getInfo(){
        return "我是服务提供者，端口号："+port+",success";
    }

    @RequestMapping("/getInfo2")
    public String getInfo2(@RequestParam("time") int time) throws InterruptedException {
        Thread.sleep(time);
        return "我是服务提供者，端口号："+port+",success,访问时间："+time+"毫秒！";
    }
}
